<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:o="http://openfaces.org/">

    <ui:composition template="/template.xhtml">
        <ui:define name="body">
            <h:form>
                <h:outputText value="#{bundle.CreateMoviesTitle}" styleClass="titulo"></h:outputText>
                <br/>
                <h:panelGrid columns="3" styleClass="panel">
                    <h:outputLabel value="#{bundle.EditMoviesLabel_movieID}" for="movieID" />
                    <h:inputText id="movieID" value="#{moviesController.selected.movieID}"
                                 title="#{bundle.EditMoviesTitle_movieID}" 
                                 required="#{moviesController.campoNulo('movieID')}" 
                                 requiredMessage="#{bundle.EditMoviesRequiredMessage_movieID}"
                                 size="#{moviesController.longCampo('movieID')}"
                                 maxlength="#{moviesController.longCampo('movieID')}"/>
                    <h:message for="movieID" errorStyle="color: red" infoStyle="color: green"/>
                    <h:outputLabel value="#{bundle.EditMoviesLabel_title}" for="title" />
                    <h:inputText id="title" value="#{moviesController.selected.title}"
                                 title="#{bundle.EditMoviesTitle_title}" 
                                 required="#{moviesController.campoNulo('title')}" 
                                 requiredMessage="#{bundle.EditMoviesRequiredMessage_title}"
                                 size="#{moviesController.longCampo('title')}"
                                 maxlength="#{moviesController.longCampo('title')}"/>
                    <h:message for="title" errorStyle="color: red" infoStyle="color: green"/>
                    <h:outputLabel value="#{bundle.EditMoviesLabel_actor}" for="actor" />
                    <h:inputText id="actor" value="#{moviesController.selected.actor}"
                                 title="#{bundle.EditMoviesTitle_actor}" 
                                 required="#{moviesController.campoNulo('actor')}" 
                                 requiredMessage="#{bundle.EditMoviesRequiredMessage_actor}"
                                 size="#{moviesController.longCampo('actor')}"
                                 maxlength="#{moviesController.longCampo('actor')}"/>
                    <h:message for="actor" errorStyle="color: red" infoStyle="color: green"/>
                </h:panelGrid>
                <br />
                <h:commandButton action="#{moviesController.create}" value="Aceptar"/>
                <h:commandButton action="#{moviesController.prepareList}" value="Cancelar" immediate="true"/>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
